# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-striprtf
_pkgorig=striprtf
pkgver=0.0.26
pkgrel=3
pkgdesc="Stripping rtf to plain old text"
url="https://github.com/joshy/striprtf"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
checkdepends="py3-pytest-xdist"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/joshy/$_pkgorig/archive/v$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
dc5334b0ad0392e646d0dff6d5c7d63fd86643a250cfebdabafaa4e94cb44db1c0c0acf3f68f8f025a798736e235f48aa5227c50b7ad81a7444c3ab8d931868e  py3-striprtf-0.0.26.tar.gz
"
